<?php
$obrig = TRUE;
        
$filial = $_SERVER['SERVER_NAME'];

$pos = strpos($filial, 'www.');
if ($pos === FALSE) $filial = 'www.'.$filial;

if($filial == 'www.garrasoledade.com.br') $obrig = FALSE;

?>

<div class="content-form edit-aluno">
    <?php echo $this->partial('aluno/menu.phtml', array('urlbase'=>$this->urlbase,'urlfoto'=>$this->urlfoto,'modulo'=>$this->modulo,'controller' => $this->controller, 'action' => $this->action, 'data' => $this->data)); ?>
    
    <div id="content-form">
        <form id="form_aluno" action="" method="post" enctype="multipart/form-data">   
            <div class="row">
                <input type="hidden" id="ALU_ID" name="ALU_ID" value="<?php echo $this->data['ALU_ID']; ?>" />
                <div class="ln"><strong>Nome:</strong> <input type="text" id="ALU_NOM" name="ALU_NOM" value="<?php echo $this->data['ALU_NOM']; ?>" required="" /></div>
                <div class="ln"><strong>CPF:</strong> <input type="text" id="ALU_CPF" name="ALU_CPF" value="<?php echo $this->data['ALU_CPF']; ?>"class="cpf" required="" /></div>
                <div class="ln"><strong>RG:</strong> <input type="text" id="ALU_RG" name="ALU_RG" value="<?php echo $this->data['ALU_RG']; ?>" class="rg" maxlength="10" /></div>
                <div class="ln"><strong>Data de Nascimento:</strong> <input type="text" id="ALU_DATNAS" name="ALU_DATNAS" value="<?php echo $this->data['ALU_DATNAS']; ?>" class="data" /></div>
                <div class="ln"><strong>CEP:</strong> <input type="text" id="ALU_CEP" name="ALU_CEP" value="<?php echo $this->data['ALU_CEP']; ?>" class="cep"  /></div>
                <div class="ln"><strong>Endereço:</strong> <input type="text" id="ALU_END" name="ALU_END" value="<?php echo $this->data['ALU_END']; ?>" class="res_endereco" <?php if($obrig) echo 'required=""'; ?> /></div>
                <div class="ln"><strong>Bairro:</strong> <input type="text" id="ALU_BAI" name="ALU_BAI" value="<?php echo $this->data['ALU_BAI']; ?>" class="res_bairro" <?php if($obrig) echo 'required=""'; ?> /></div>
                <div class="ln"><strong>Cidade:</strong> <input type="text" id="ALU_CID" name="ALU_CID" value="<?php echo $this->data['ALU_CID']; ?>" class="res_cidade" <?php if($obrig) echo 'required=""'; ?> /> <strong>UF:</strong> <input type="text" id="ALU_UF" name="ALU_UF" value="<?php echo $this->data['ALU_UF']; ?>" maxlength="2" class="uf res_uf" <?php if($obrig) echo 'required=""'; ?> /></div>
                <div class="ln"><strong>Telefone:</strong> <input type="text" id="ALU_TEL" name="ALU_TEL" value="<?php echo $this->data['ALU_TEL']; ?>" class="telefone" required="" /></div>
                <div class="ln"><strong>Telefone 2:</strong> <input type="text" id="ALU_CEL" name="ALU_CEL" value="<?php echo $this->data['ALU_CEL']; ?>" class="telefone" /></div>
                <div class="ln"><strong>Email:</strong> <input type="text" id="ALU_EML" name="ALU_EML" value="<?php echo $this->data['ALU_EML']; ?>" class="email" required="" /></div>
                <div class="ln"><strong>Facebook:</strong> <input type="text" id="ALU_FCB" name="ALU_FCB" value="<?php echo $this->data['ALU_FCB']; ?>"  /></div>
            </div>
            <br>
            <div class="row">
                <div class="ln"><strong>Pai:</strong> <input type="text" id="ALU_PAINOM" name="ALU_PAINOM" value="<?php echo $this->data['ALU_PAINOM']; ?>"  /></div>
                <div class="ln"><strong>CPF:</strong> <input type="text" id="ALU_PAICPF" name="ALU_PAICPF" value="<?php echo $this->data['ALU_PAICPF']; ?>" class="cpf"  /></div>
                <div class="ln"><strong>Telefone:</strong> <input type="text" id="ALU_PAITEL" name="ALU_PAITEL" value="<?php echo $this->data['ALU_PAITEL']; ?>" class="telefone" /></div>
                <div class="ln"><strong>Email:</strong> <input type="text" id="ALU_PAIEML" name="ALU_PAIEML" value="<?php echo $this->data['ALU_PAIEML']; ?>" class="email"  /></div>
                <div class="ln"><strong>Data de Nascimento:</strong> <input type="text" id="ALU_PAIDATNAS" name="ALU_PAIDATNAS" value="<?php echo $this->data['ALU_PAIDATNAS']; ?>" class="data" /></div>
                <div class="ln" id="div_ALU_PAIPRF"><strong>Profissão:</strong> 
                <?php
                    /* <input type="text" id="ALU_PAIPRF" name="ALU_PAIPRF" value="<?php echo $this->data['ALU_PAIPRF']; ?>" required="" />*/
                    $html = '<select id="ALU_PAIPRF" name="ALU_PAIPRF" class="chosen-select"><option value="0">Nenhum</option>';
                    foreach($this->prf as $r){  
                        $selected = $r['PRF_ID'] == $this->data['ALU_PAIPRF']  ? 'selected=""':'';            
                        $html .= '<option '.$selected.' value="'.$r['PRF_ID'].'">'.$r['PRF_NOM'].'</option>'; 
                    }
                    echo $html .= '</select>';
                ?>
                    <a href="javascript:void(0)" class="edit_profissao">+</a>
                </div>
                <br>
                <div class="ln"><strong>Mãe:</strong> <input type="text" id="ALU_MAENOM" name="ALU_MAENOM" value="<?php echo $this->data['ALU_MAENOM']; ?>" /></div>
                <div class="ln"><strong>CPF:</strong> <input type="text" id="ALU_MAECPF" name="ALU_MAECPF" value="<?php echo $this->data['ALU_MAECPF']; ?>" class="cpf" /></div>
                <div class="ln"><strong>Telefone:</strong> <input type="text" id="ALU_MAETEL" name="ALU_MAETEL" value="<?php echo $this->data['ALU_MAETEL']; ?>" class="telefone" /></div>
                <div class="ln"><strong>Email:</strong> <input type="text" id="ALU_MAEEML" name="ALU_MAEEML" value="<?php echo $this->data['ALU_MAEEML']; ?>" class="email"  /></div>
                <div class="ln"><strong>Data de Nascimento:</strong> <input type="text" id="ALU_MAEDATNAS" name="ALU_MAEDATNAS" value="<?php echo $this->data['ALU_MAEDATNAS']; ?>" class="data"/></div>
                <div class="ln" id="div_ALU_MAEPRF"><strong>Profissão:</strong> 
                <?php
                    /* <input type="text" id="ALU_MAEPRF" name="ALU_MAEPRF" value="<?php echo $this->data['ALU_MAEPRF']; ?>" required="" />*/
                    $html = '<select id="ALU_MAEPRF" name="ALU_MAEPRF" class="chosen-select"><option value="0">Nenhum</option>';
                    foreach($this->prf as $r){  
                        $selected = $r['PRF_ID'] == $this->data['ALU_MAEPRF']  ? 'selected=""':'';            
                        $html .= '<option '.$selected.' value="'.$r['PRF_ID'].'">'.$r['PRF_NOM'].'</option>'; 
                    }
                    echo $html .= '</select>';
                ?>
                    <a href="javascript:void(0)" class="edit_profissao">+</a>
                </div>
            </div>
            <br>
            <?php  if($this->data['ALU_ID'] > 0){ ?>
            <div class="row">
                <?php /* if($this->data['ALU_ID'] == 0){ ?>
                <div class="ln"><strong>Login:</strong> <input type="text" id="ALU_LOG" name="ALU_LOG" value="<?php echo $this->data['ALU_LOG']; ?>" required="" /></div>
                <div class="ln"><strong>Senha:</strong> <input type="password" id="ALU_SNH" name="ALU_SNH" value="" required="" /></div>
                <div class="ln"><strong>Repita Senha:</strong> <input type="password" id="ALU_SNH2" name="ALU_SNH2" value="" required="" /></div>
                <?php } else { */ ?>
                <div class="ln"><strong>Login:</strong> <input type="text" id="ALU_LOG" name="ALU_LOG" value="<?php echo $this->data['ALU_LOG']; ?>" readonly="" /></div>    
                <?php //} ?>
            </div>
            <br>
            <?php } ?>
            <div class="row cnt-frm-btn">
                <input type="submit" name="submit" id="submitbutton" value="Salvar" class="btn-frm">

                <a href="<?php echo $this->urlmodulo.'/'.$this->controller; ?>" class="btn-frm">voltar</a>
            </div>
        </form>
    </div>
</div>
<div id="dialog"></div>
